const fs = require('fs');
const path = require('path');

// 读取淘宝进货单数据
const taobaoDataPath = path.join(__dirname, '通过插件拦截响应数据（淘宝进货单）.md');
let taobaoData;

try {
  const data = fs.readFileSync(taobaoDataPath, 'utf8');
  taobaoData = JSON.parse(data);
  console.log('成功读取淘宝进货单数据');
} catch (error) {
  console.error('读取淘宝进货单数据失败:', error);
  process.exit(1);
}

// 获取第一个数据项
const firstItem = taobaoData.data[0];

console.log('数据项URL:', firstItem.url);
console.log('响应数据结构:');
console.log('response:', Object.keys(firstItem.response));
console.log('response.data:', Object.keys(firstItem.response.data));

// 检查实际的数据结构
if (firstItem.response.data.data) {
  console.log('response.data.data:', Object.keys(firstItem.response.data.data));
  
  // 查找订单相关的键
  const dataKeys = Object.keys(firstItem.response.data.data);
  console.log('订单相关键:');
  dataKeys.forEach(key => {
    if (key.includes('shopOrder') || key.includes('order')) {
      console.log('  ', key);
    }
  });
}